Skip to content

Fix typo in GPU device placement for mu_median_vec#21

Merged
cgiovanetti merged 1 commit intomainfrom
siddharth/fix-gpu-typo
Jan 26, 2026
Merged

Fix typo in GPU device placement for mu_median_vec#21
cgiovanetti merged 1 commit intomainfrom
siddharth/fix-gpu-typo

Conversation

@smsharma
Copy link
Collaborator

The Bug

File: linx/reactions.py, line 147

self.mu_median_vec = jax.device_put(
    self.mu_media_vec, device=gpus[0]  # BUG: mu_media_vec doesn't exist!
)

The code references self.mu_media_vec but the attribute is actually named self.mu_median_vec (set on line 138).

Impact

Because this is wrapped in a bare except: pass, the error is silently swallowed. This means:

  1. Nuclear rate spline data is never placed on GPU even when a GPU is available
  2. Could cause device mismatch errors in downstream JAX computations
  3. Degraded performance (data stays on CPU while computations run on GPU)

The Fix

Change self.mu_media_vecself.mu_median_vec

🤖 Generated with Claude Code

BUG: Line 147 referenced `self.mu_media_vec` which doesn't exist.
The correct attribute name is `self.mu_median_vec`.

This typo caused the GPU device placement to silently fail (caught by
bare except), meaning nuclear rate spline data was never placed on GPU
even when a GPU was available. This could cause:
1. Degraded performance (data stays on CPU)
2. Potential device mismatch errors in downstream computations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@smsharma smsharma requested a review from cgiovanetti January 24, 2026 02:30
Copy link
Owner

@cgiovanetti cgiovanetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this is also fixed on branch cara/me-hardcode but it's helpful to have it fixed on main as well!

@cgiovanetti cgiovanetti merged commit b9c7728 into main Jan 26, 2026
1 check passed
@cgiovanetti cgiovanetti deleted the siddharth/fix-gpu-typo branch January 26, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants